

module.exports = function () {

    let state_b = this.state.boolean_space
    let state = this.state
    function getThis() {
        return this
    }

    //打开遮照
    function open_orerlay() {
        if (state_b.orerlay_status && state.orerlay_window != null) {
            state.orerlay_window.close()
        }
        state.orerlay_window = floaty.rawWindow(
            <frame bg="#66000000"></frame>
        )
        state.orerlay_window.setSize(-1, -1)
        state.orerlay_window.setTouchable(false)
        state_b.orerlay_status = !state_b.orerlay_status
    }

    //关闭遮罩层
    function close_orerlay() {
        if (!state_b.orerlay_status) return;
        state.orerlay_window.close()
        state_b.orerlay_status = !state_b.orerlay_status
    }

    return {
        getThis: getThis.bind(this),
        open_orerlay: open_orerlay.bind(this),
        close_orerlay: close_orerlay.bind(this)
    }
}

